local thbattle__uuz_fanhun = fk.CreateSkill {

  name = "thbattle__uuz_fanhun",

  tags = { Skill.Compulsory, },

}



thbattle__uuz_fanhun:addEffect(fk.Deathed, {
  anim_type = "support",
  events = { fk.Deathed },
  can_trigger=function (self, event, target, player, data)
    return target~=player and player:hasSkill(thbattle__uuz_fanhun.name)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if not player:isWounded() or room:askForSkillInvoke(player, thbattle__uuz_fanhun.name, nil, "#thbattle__uuz_fanhun") then
      room:changeMaxHp(player, 1)
    else
      room:recover({
        who = player,
        num = 1,
        recoverBy = player,
        skillName = thbattle__uuz_fanhun.name
      })
    end
  end
})

thbattle__uuz_fanhun:addEffect("maxcards", {
  fixed_func=function (self, player)
    if player:hasSkill(thbattle__uuz_fanhun.name) then
      return player.maxHp
    end
  end
})

return thbattle__uuz_fanhun